import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

const routes = [
    {
        path: '/',
        redirect: '/invoice/list',
    },
    {
        path: '/invoice/list',
        component: () =>
            import(
                /* webpackChunkName: "invoice" */ '../views/InvoiceList.vue'
            ),
    },
    {
        path: '/invoice/add',
        component: () =>
            import(/* webpackChunkName: "invoice" */ '../views/InvoiceAdd.vue'),
    },
    {
        path: '/invoice/edit/:id',
        component: () =>
            import(
                /* webpackChunkName: "invoice" */ '../views/InvoiceEdit.vue'
            ),
    },
];

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes,
});

export default router;
